#pragma once
#ifndef H_Triangle
#define H_Triangle

#include <stdio.h>

#include "Object.h"
#include "Globals.h"
#include <time.h>
#include "DebugWriter.h"

class Triangle: public Object {
	public:
		Triangle(Vector3 p0,  Vector3 n0,  Vector3 p1,  Vector3 n1,  Vector3 p2,  Vector3 n2);
		Triangle(Vector3 p0, Vector3 p1, Vector3 p2);
		
		float tIntersect(Vector3 p, Vector3 r, Object* obj);
		Object* tIntersect(const Ray& ray, float& distance);
		Vector3 normal(Vector3 at);
		Vector3 normal();
		float getArea();

		Vector3 p0, p1, p2;
		float intensity;

private:
		Vector3 center;
		float area;
		
		Vector3 n0, n1, n2;
};
#endif